{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "a1d1a62f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "214f62fb",
   "metadata": {},
   "outputs": [],
   "source": [
    "#导入.csv文件，用read_csv(),并读取前100行以及各列\n",
    "df = pd.read_csv('Factors .csv',encoding='gbk')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "2daacd9b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>province</th>\n",
       "      <th>index</th>\n",
       "      <th>gdp</th>\n",
       "      <th>resident</th>\n",
       "      <th>price</th>\n",
       "      <th>income</th>\n",
       "      <th>inflow</th>\n",
       "      <th>household</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>深圳市</td>\n",
       "      <td>0.914</td>\n",
       "      <td>30664.85</td>\n",
       "      <td>1768</td>\n",
       "      <td>71209</td>\n",
       "      <td>70847</td>\n",
       "      <td>1178.80</td>\n",
       "      <td>589.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海市</td>\n",
       "      <td>0.791</td>\n",
       "      <td>43214.85</td>\n",
       "      <td>2489</td>\n",
       "      <td>66801</td>\n",
       "      <td>78027</td>\n",
       "      <td>1009.00</td>\n",
       "      <td>1480.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>北京市</td>\n",
       "      <td>0.758</td>\n",
       "      <td>40269.60</td>\n",
       "      <td>2189</td>\n",
       "      <td>63809</td>\n",
       "      <td>75002</td>\n",
       "      <td>788.20</td>\n",
       "      <td>1400.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>广州市</td>\n",
       "      <td>0.723</td>\n",
       "      <td>28231.97</td>\n",
       "      <td>1881</td>\n",
       "      <td>46145</td>\n",
       "      <td>68908</td>\n",
       "      <td>888.92</td>\n",
       "      <td>992.08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>武汉市</td>\n",
       "      <td>0.646</td>\n",
       "      <td>17716.76</td>\n",
       "      <td>1364</td>\n",
       "      <td>19846</td>\n",
       "      <td>41253</td>\n",
       "      <td>316.50</td>\n",
       "      <td>1047.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>赣州市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>4169.37</td>\n",
       "      <td>879</td>\n",
       "      <td>8195</td>\n",
       "      <td>26899</td>\n",
       "      <td>9.80</td>\n",
       "      <td>869.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>宜春市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>3191.28</td>\n",
       "      <td>500</td>\n",
       "      <td>7754</td>\n",
       "      <td>28268</td>\n",
       "      <td>-32.10</td>\n",
       "      <td>532.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>驻马店市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>3100.00</td>\n",
       "      <td>700</td>\n",
       "      <td>5467</td>\n",
       "      <td>22440</td>\n",
       "      <td>9.20</td>\n",
       "      <td>690.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>曲靖市</td>\n",
       "      <td>0.225</td>\n",
       "      <td>3393.91</td>\n",
       "      <td>576</td>\n",
       "      <td>5877</td>\n",
       "      <td>30545</td>\n",
       "      <td>2.68</td>\n",
       "      <td>573.32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>鄂尔多斯</td>\n",
       "      <td>0.196</td>\n",
       "      <td>4715.70</td>\n",
       "      <td>215</td>\n",
       "      <td>8253</td>\n",
       "      <td>45638</td>\n",
       "      <td>16.36</td>\n",
       "      <td>198.64</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   province  index       gdp  resident   price  income   inflow  household\n",
       "0      深圳市   0.914  30664.85      1768   71209   70847  1178.80     589.20\n",
       "1     上海市    0.791  43214.85      2489   66801   78027  1009.00    1480.00\n",
       "2     北京市    0.758  40269.60      2189   63809   75002   788.20    1400.40\n",
       "3      广州市   0.723  28231.97      1881   46145   68908   888.92     992.08\n",
       "4      武汉市   0.646  17716.76      1364   19846   41253   316.50    1047.50\n",
       "..      ...    ...       ...       ...     ...     ...      ...        ...\n",
       "95     赣州市   0.248   4169.37       879    8195   26899     9.80     869.20\n",
       "96     宜春市   0.248   3191.28       500    7754   28268   -32.10     532.10\n",
       "97    驻马店市   0.248   3100.00       700    5467   22440     9.20     690.80\n",
       "98     曲靖市   0.225   3393.91       576    5877   30545     2.68     573.32\n",
       "99    鄂尔多斯   0.196   4715.70       215    8253   45638    16.36     198.64\n",
       "\n",
       "[100 rows x 8 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "a071c305",
   "metadata": {},
   "outputs": [],
   "source": [
    "#导入.csv文件，用read_csv(),并读取前100行以及0,1,2三列\n",
    "df = pd.read_csv('Factors .csv',encoding='gbk',nrows=101,usecols=[0,1,2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "a3ed5625",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>province</th>\n",
       "      <th>index</th>\n",
       "      <th>gdp</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>深圳市</td>\n",
       "      <td>0.914</td>\n",
       "      <td>30664.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海市</td>\n",
       "      <td>0.791</td>\n",
       "      <td>43214.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>北京市</td>\n",
       "      <td>0.758</td>\n",
       "      <td>40269.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>广州市</td>\n",
       "      <td>0.723</td>\n",
       "      <td>28231.97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>武汉市</td>\n",
       "      <td>0.646</td>\n",
       "      <td>17716.76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>赣州市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>4169.37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>宜春市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>3191.28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>驻马店市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>3100.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>曲靖市</td>\n",
       "      <td>0.225</td>\n",
       "      <td>3393.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>鄂尔多斯</td>\n",
       "      <td>0.196</td>\n",
       "      <td>4715.70</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   province  index       gdp\n",
       "0      深圳市   0.914  30664.85\n",
       "1     上海市    0.791  43214.85\n",
       "2     北京市    0.758  40269.60\n",
       "3      广州市   0.723  28231.97\n",
       "4      武汉市   0.646  17716.76\n",
       "..      ...    ...       ...\n",
       "95     赣州市   0.248   4169.37\n",
       "96     宜春市   0.248   3191.28\n",
       "97    驻马店市   0.248   3100.00\n",
       "98     曲靖市   0.225   3393.91\n",
       "99    鄂尔多斯   0.196   4715.70\n",
       "\n",
       "[100 rows x 3 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "29c8cbe1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 100 entries, 0 to 99\n",
      "Data columns (total 3 columns):\n",
      " #   Column    Non-Null Count  Dtype  \n",
      "---  ------    --------------  -----  \n",
      " 0   province  100 non-null    object \n",
      " 1   index     100 non-null    float64\n",
      " 2   gdp       100 non-null    float64\n",
      "dtypes: float64(2), object(1)\n",
      "memory usage: 2.5+ KB\n"
     ]
    }
   ],
   "source": [
    "#了解数据概况，100行，3列\n",
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "409acb89",
   "metadata": {},
   "outputs": [],
   "source": [
    "index = df[\"index\"].to_list()\n",
    "gdp = df[\"gdp\"].to_list()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "4e6b779a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Scatter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "a6979571",
   "metadata": {},
   "outputs": [],
   "source": [
    "scatter = (\n",
    "    Scatter()\n",
    "    .add_xaxis(\n",
    "        xaxis_data=gdp#定义x数据\n",
    "    )\n",
    "    .add_yaxis(\n",
    "        series_name=\"\",\n",
    "        y_axis=index,#定义y数据\n",
    "        symbol_size=4,#点的大小\n",
    "        label_opts=opts.LabelOpts(is_show=False)#不显示数值\n",
    "    )\n",
    "    .set_global_opts(#全局参数\n",
    "        xaxis_opts=opts.AxisOpts(type_=\"value\"),\n",
    "        yaxis_opts=opts.AxisOpts(type_=\"value\"),#y数据作为数值处理\n",
    "        title_opts=opts.TitleOpts(title=\"Diagram of (index-gdp)\",pos_left=\"ceter\")\n",
    "    )\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "104df251",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"90f9e7f418e24a54add6a876b4417592\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_90f9e7f418e24a54add6a876b4417592 = echarts.init(\n",
       "                    document.getElementById('90f9e7f418e24a54add6a876b4417592'), 'white', {renderer: 'canvas'});\n",
       "                var option_90f9e7f418e24a54add6a876b4417592 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    30664.85,\n",
       "                    0.914\n",
       "                ],\n",
       "                [\n",
       "                    43214.85,\n",
       "                    0.791\n",
       "                ],\n",
       "                [\n",
       "                    40269.6,\n",
       "                    0.758\n",
       "                ],\n",
       "                [\n",
       "                    28231.97,\n",
       "                    0.723\n",
       "                ],\n",
       "                [\n",
       "                    17716.76,\n",
       "                    0.646\n",
       "                ],\n",
       "                [\n",
       "                    22718.3,\n",
       "                    0.645\n",
       "                ],\n",
       "                [\n",
       "                    16355.32,\n",
       "                    0.645\n",
       "                ],\n",
       "                [\n",
       "                    7033.89,\n",
       "                    0.607\n",
       "                ],\n",
       "                [\n",
       "                    14003.24,\n",
       "                    0.604\n",
       "                ],\n",
       "                [\n",
       "                    18109.0,\n",
       "                    0.598\n",
       "                ],\n",
       "                [\n",
       "                    10855.35,\n",
       "                    0.593\n",
       "                ],\n",
       "                [\n",
       "                    19916.98,\n",
       "                    0.59\n",
       "                ],\n",
       "                [\n",
       "                    12156.54,\n",
       "                    0.585\n",
       "                ],\n",
       "                [\n",
       "                    11412.8,\n",
       "                    0.582\n",
       "                ],\n",
       "                [\n",
       "                    13270.7,\n",
       "                    0.57\n",
       "                ],\n",
       "                [\n",
       "                    12691.02,\n",
       "                    0.564\n",
       "                ],\n",
       "                [\n",
       "                    15695.1,\n",
       "                    0.56\n",
       "                ],\n",
       "                [\n",
       "                    14136.46,\n",
       "                    0.559\n",
       "                ],\n",
       "                [\n",
       "                    14594.9,\n",
       "                    0.547\n",
       "                ],\n",
       "                [\n",
       "                    3881.73,\n",
       "                    0.546\n",
       "                ],\n",
       "                [\n",
       "                    10688.28,\n",
       "                    0.532\n",
       "                ],\n",
       "                [\n",
       "                    11432.22,\n",
       "                    0.53\n",
       "                ],\n",
       "                [\n",
       "                    8807.6,\n",
       "                    0.529\n",
       "                ],\n",
       "                [\n",
       "                    3566.17,\n",
       "                    0.508\n",
       "                ],\n",
       "                [\n",
       "                    11324.48,\n",
       "                    0.487\n",
       "                ],\n",
       "                [\n",
       "                    11026.9,\n",
       "                    0.487\n",
       "                ],\n",
       "                [\n",
       "                    27894.02,\n",
       "                    0.471\n",
       "                ],\n",
       "                [\n",
       "                    11304.17,\n",
       "                    0.465\n",
       "                ],\n",
       "                [\n",
       "                    7825.9,\n",
       "                    0.461\n",
       "                ],\n",
       "                [\n",
       "                    6355.28,\n",
       "                    0.461\n",
       "                ],\n",
       "                [\n",
       "                    6650.53,\n",
       "                    0.46\n",
       "                ],\n",
       "                [\n",
       "                    4763.42,\n",
       "                    0.455\n",
       "                ],\n",
       "                [\n",
       "                    6696.43,\n",
       "                    0.449\n",
       "                ],\n",
       "                [\n",
       "                    8117.44,\n",
       "                    0.437\n",
       "                ],\n",
       "                [\n",
       "                    7249.7,\n",
       "                    0.436\n",
       "                ],\n",
       "                [\n",
       "                    8711.75,\n",
       "                    0.431\n",
       "                ],\n",
       "                [\n",
       "                    5121.61,\n",
       "                    0.421\n",
       "                ],\n",
       "                [\n",
       "                    6795.26,\n",
       "                    0.417\n",
       "                ],\n",
       "                [\n",
       "                    6025.26,\n",
       "                    0.417\n",
       "                ],\n",
       "                [\n",
       "                    7222.5,\n",
       "                    0.414\n",
       "                ],\n",
       "                [\n",
       "                    4711.04,\n",
       "                    0.407\n",
       "                ],\n",
       "                [\n",
       "                    7585.0,\n",
       "                    0.406\n",
       "                ],\n",
       "                [\n",
       "                    8230.6,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    7103.12,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    4302.63,\n",
       "                    0.387\n",
       "                ],\n",
       "                [\n",
       "                    5786.19,\n",
       "                    0.384\n",
       "                ],\n",
       "                [\n",
       "                    6490.3,\n",
       "                    0.379\n",
       "                ],\n",
       "                [\n",
       "                    4200.62,\n",
       "                    0.377\n",
       "                ],\n",
       "                [\n",
       "                    5355.44,\n",
       "                    0.376\n",
       "                ],\n",
       "                [\n",
       "                    4977.36,\n",
       "                    0.374\n",
       "                ],\n",
       "                [\n",
       "                    3644.87,\n",
       "                    0.373\n",
       "                ],\n",
       "                [\n",
       "                    3463.93,\n",
       "                    0.369\n",
       "                ],\n",
       "                [\n",
       "                    5447.1,\n",
       "                    0.366\n",
       "                ],\n",
       "                [\n",
       "                    7010.6,\n",
       "                    0.364\n",
       "                ],\n",
       "                [\n",
       "                    6617.39,\n",
       "                    0.362\n",
       "                ],\n",
       "                [\n",
       "                    3691.57,\n",
       "                    0.36\n",
       "                ],\n",
       "                [\n",
       "                    5025.4,\n",
       "                    0.358\n",
       "                ],\n",
       "                [\n",
       "                    3655.4,\n",
       "                    0.358\n",
       "                ],\n",
       "                [\n",
       "                    3553.1,\n",
       "                    0.353\n",
       "                ],\n",
       "                [\n",
       "                    3719.01,\n",
       "                    0.349\n",
       "                ],\n",
       "                [\n",
       "                    4550.13,\n",
       "                    0.346\n",
       "                ],\n",
       "                [\n",
       "                    5120.94,\n",
       "                    0.345\n",
       "                ],\n",
       "                [\n",
       "                    3727.92,\n",
       "                    0.345\n",
       "                ],\n",
       "                [\n",
       "                    3231.29,\n",
       "                    0.343\n",
       "                ],\n",
       "                [\n",
       "                    5069.96,\n",
       "                    0.336\n",
       "                ],\n",
       "                [\n",
       "                    3441.72,\n",
       "                    0.334\n",
       "                ],\n",
       "                [\n",
       "                    5022.69,\n",
       "                    0.328\n",
       "                ],\n",
       "                [\n",
       "                    5309.43,\n",
       "                    0.327\n",
       "                ],\n",
       "                [\n",
       "                    3601.28,\n",
       "                    0.325\n",
       "                ],\n",
       "                [\n",
       "                    3420.26,\n",
       "                    0.319\n",
       "                ],\n",
       "                [\n",
       "                    3232.53,\n",
       "                    0.318\n",
       "                ],\n",
       "                [\n",
       "                    5351.7,\n",
       "                    0.313\n",
       "                ],\n",
       "                [\n",
       "                    5465.5,\n",
       "                    0.31\n",
       "                ],\n",
       "                [\n",
       "                    4402.98,\n",
       "                    0.309\n",
       "                ],\n",
       "                [\n",
       "                    3121.4,\n",
       "                    0.309\n",
       "                ],\n",
       "                [\n",
       "                    4342.22,\n",
       "                    0.298\n",
       "                ],\n",
       "                [\n",
       "                    3698.1,\n",
       "                    0.298\n",
       "                ],\n",
       "                [\n",
       "                    4050.1,\n",
       "                    0.297\n",
       "                ],\n",
       "                [\n",
       "                    4163.4,\n",
       "                    0.294\n",
       "                ],\n",
       "                [\n",
       "                    3488.72,\n",
       "                    0.294\n",
       "                ],\n",
       "                [\n",
       "                    4114.8,\n",
       "                    0.292\n",
       "                ],\n",
       "                [\n",
       "                    3840.31,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    3400.9,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    3350.29,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    3559.63,\n",
       "                    0.287\n",
       "                ],\n",
       "                [\n",
       "                    3362.1,\n",
       "                    0.286\n",
       "                ],\n",
       "                [\n",
       "                    3976.67,\n",
       "                    0.282\n",
       "                ],\n",
       "                [\n",
       "                    3151.08,\n",
       "                    0.282\n",
       "                ],\n",
       "                [\n",
       "                    3735.68,\n",
       "                    0.276\n",
       "                ],\n",
       "                [\n",
       "                    3725.0,\n",
       "                    0.274\n",
       "                ],\n",
       "                [\n",
       "                    4169.6,\n",
       "                    0.271\n",
       "                ],\n",
       "                [\n",
       "                    3148.08,\n",
       "                    0.27\n",
       "                ],\n",
       "                [\n",
       "                    3496.23,\n",
       "                    0.267\n",
       "                ],\n",
       "                [\n",
       "                    5435.2,\n",
       "                    0.263\n",
       "                ],\n",
       "                [\n",
       "                    3293.0,\n",
       "                    0.254\n",
       "                ],\n",
       "                [\n",
       "                    4169.37,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    3191.28,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    3100.0,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    3393.91,\n",
       "                    0.225\n",
       "                ],\n",
       "                [\n",
       "                    4715.7,\n",
       "                    0.196\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                30664.85,\n",
       "                43214.85,\n",
       "                40269.6,\n",
       "                28231.97,\n",
       "                17716.76,\n",
       "                22718.3,\n",
       "                16355.32,\n",
       "                7033.89,\n",
       "                14003.24,\n",
       "                18109.0,\n",
       "                10855.35,\n",
       "                19916.98,\n",
       "                12156.54,\n",
       "                11412.8,\n",
       "                13270.7,\n",
       "                12691.02,\n",
       "                15695.1,\n",
       "                14136.46,\n",
       "                14594.9,\n",
       "                3881.73,\n",
       "                10688.28,\n",
       "                11432.22,\n",
       "                8807.6,\n",
       "                3566.17,\n",
       "                11324.48,\n",
       "                11026.9,\n",
       "                27894.02,\n",
       "                11304.17,\n",
       "                7825.9,\n",
       "                6355.28,\n",
       "                6650.53,\n",
       "                4763.42,\n",
       "                6696.43,\n",
       "                8117.44,\n",
       "                7249.7,\n",
       "                8711.75,\n",
       "                5121.61,\n",
       "                6795.26,\n",
       "                6025.26,\n",
       "                7222.5,\n",
       "                4711.04,\n",
       "                7585.0,\n",
       "                8230.6,\n",
       "                7103.12,\n",
       "                4302.63,\n",
       "                5786.19,\n",
       "                6490.3,\n",
       "                4200.62,\n",
       "                5355.44,\n",
       "                4977.36,\n",
       "                3644.87,\n",
       "                3463.93,\n",
       "                5447.1,\n",
       "                7010.6,\n",
       "                6617.39,\n",
       "                3691.57,\n",
       "                5025.4,\n",
       "                3655.4,\n",
       "                3553.1,\n",
       "                3719.01,\n",
       "                4550.13,\n",
       "                5120.94,\n",
       "                3727.92,\n",
       "                3231.29,\n",
       "                5069.96,\n",
       "                3441.72,\n",
       "                5022.69,\n",
       "                5309.43,\n",
       "                3601.28,\n",
       "                3420.26,\n",
       "                3232.53,\n",
       "                5351.7,\n",
       "                5465.5,\n",
       "                4402.98,\n",
       "                3121.4,\n",
       "                4342.22,\n",
       "                3698.1,\n",
       "                4050.1,\n",
       "                4163.4,\n",
       "                3488.72,\n",
       "                4114.8,\n",
       "                3840.31,\n",
       "                3400.9,\n",
       "                3350.29,\n",
       "                3559.63,\n",
       "                3362.1,\n",
       "                3976.67,\n",
       "                3151.08,\n",
       "                3735.68,\n",
       "                3725.0,\n",
       "                4169.6,\n",
       "                3148.08,\n",
       "                3496.23,\n",
       "                5435.2,\n",
       "                3293.0,\n",
       "                4169.37,\n",
       "                3191.28,\n",
       "                3100.0,\n",
       "                3393.91,\n",
       "                4715.7\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Diagram of (index-gdp)\",\n",
       "            \"left\": \"ceter\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_90f9e7f418e24a54add6a876b4417592.setOption(option_90f9e7f418e24a54add6a876b4417592);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e3b7fe61f0>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "scatter.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "8e20bf7c",
   "metadata": {},
   "outputs": [],
   "source": [
    "#导入.csv文件，用read_csv(),并读取前100行以及0,1,3三列\n",
    "df = pd.read_csv('Factors .csv',encoding='gbk',nrows=101,usecols=[0,1,3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "00cef277",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>province</th>\n",
       "      <th>index</th>\n",
       "      <th>resident</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>深圳市</td>\n",
       "      <td>0.914</td>\n",
       "      <td>1768</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海市</td>\n",
       "      <td>0.791</td>\n",
       "      <td>2489</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>北京市</td>\n",
       "      <td>0.758</td>\n",
       "      <td>2189</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>广州市</td>\n",
       "      <td>0.723</td>\n",
       "      <td>1881</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>武汉市</td>\n",
       "      <td>0.646</td>\n",
       "      <td>1364</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>赣州市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>879</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>宜春市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>驻马店市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>曲靖市</td>\n",
       "      <td>0.225</td>\n",
       "      <td>576</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>鄂尔多斯</td>\n",
       "      <td>0.196</td>\n",
       "      <td>215</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   province  index  resident\n",
       "0      深圳市   0.914      1768\n",
       "1     上海市    0.791      2489\n",
       "2     北京市    0.758      2189\n",
       "3      广州市   0.723      1881\n",
       "4      武汉市   0.646      1364\n",
       "..      ...    ...       ...\n",
       "95     赣州市   0.248       879\n",
       "96     宜春市   0.248       500\n",
       "97    驻马店市   0.248       700\n",
       "98     曲靖市   0.225       576\n",
       "99    鄂尔多斯   0.196       215\n",
       "\n",
       "[100 rows x 3 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "d92b0d08",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 100 entries, 0 to 99\n",
      "Data columns (total 3 columns):\n",
      " #   Column    Non-Null Count  Dtype  \n",
      "---  ------    --------------  -----  \n",
      " 0   province  100 non-null    object \n",
      " 1   index     100 non-null    float64\n",
      " 2   resident  100 non-null    int64  \n",
      "dtypes: float64(1), int64(1), object(1)\n",
      "memory usage: 2.5+ KB\n"
     ]
    }
   ],
   "source": [
    "#了解数据概况，100行，3列\n",
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "85407977",
   "metadata": {},
   "outputs": [],
   "source": [
    "index = df[\"index\"].to_list()\n",
    "resident = df[\"resident\"].to_list()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "0699ab19",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Scatter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "904bba4d",
   "metadata": {},
   "outputs": [],
   "source": [
    "scatter = (\n",
    "    Scatter()\n",
    "    .add_xaxis(\n",
    "        xaxis_data=resident#定义x数据\n",
    "    )\n",
    "    .add_yaxis(\n",
    "        series_name=\"\",\n",
    "        y_axis=index,#定义y数据\n",
    "        symbol_size=4,#点的大小\n",
    "        label_opts=opts.LabelOpts(is_show=False)#不显示数值\n",
    "    )\n",
    "    .set_global_opts(#全局参数\n",
    "        xaxis_opts=opts.AxisOpts(type_=\"value\"),\n",
    "        yaxis_opts=opts.AxisOpts(type_=\"value\"),#y数据作为数值处理\n",
    "        title_opts=opts.TitleOpts(title=\"Diagram of (index-resident)\",pos_left=\"ceter\")\n",
    "    )\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "f87d2aa8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"1f332a62341746689f311aa2cd32b308\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_1f332a62341746689f311aa2cd32b308 = echarts.init(\n",
       "                    document.getElementById('1f332a62341746689f311aa2cd32b308'), 'white', {renderer: 'canvas'});\n",
       "                var option_1f332a62341746689f311aa2cd32b308 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    1768,\n",
       "                    0.914\n",
       "                ],\n",
       "                [\n",
       "                    2489,\n",
       "                    0.791\n",
       "                ],\n",
       "                [\n",
       "                    2189,\n",
       "                    0.758\n",
       "                ],\n",
       "                [\n",
       "                    1881,\n",
       "                    0.723\n",
       "                ],\n",
       "                [\n",
       "                    1364,\n",
       "                    0.646\n",
       "                ],\n",
       "                [\n",
       "                    1284,\n",
       "                    0.645\n",
       "                ],\n",
       "                [\n",
       "                    942,\n",
       "                    0.645\n",
       "                ],\n",
       "                [\n",
       "                    528,\n",
       "                    0.607\n",
       "                ],\n",
       "                [\n",
       "                    747,\n",
       "                    0.604\n",
       "                ],\n",
       "                [\n",
       "                    1220,\n",
       "                    0.598\n",
       "                ],\n",
       "                [\n",
       "                    1053,\n",
       "                    0.593\n",
       "                ],\n",
       "                [\n",
       "                    2119,\n",
       "                    0.59\n",
       "                ],\n",
       "                [\n",
       "                    961,\n",
       "                    0.585\n",
       "                ],\n",
       "                [\n",
       "                    946,\n",
       "                    0.582\n",
       "                ],\n",
       "                [\n",
       "                    1023,\n",
       "                    0.57\n",
       "                ],\n",
       "                [\n",
       "                    1274,\n",
       "                    0.564\n",
       "                ],\n",
       "                [\n",
       "                    1373,\n",
       "                    0.56\n",
       "                ],\n",
       "                [\n",
       "                    1025,\n",
       "                    0.559\n",
       "                ],\n",
       "                [\n",
       "                    954,\n",
       "                    0.547\n",
       "                ],\n",
       "                [\n",
       "                    244,\n",
       "                    0.546\n",
       "                ],\n",
       "                [\n",
       "                    1316,\n",
       "                    0.532\n",
       "                ],\n",
       "                [\n",
       "                    933,\n",
       "                    0.53\n",
       "                ],\n",
       "                [\n",
       "                    534,\n",
       "                    0.529\n",
       "                ],\n",
       "                [\n",
       "                    441,\n",
       "                    0.508\n",
       "                ],\n",
       "                [\n",
       "                    842,\n",
       "                    0.487\n",
       "                ],\n",
       "                [\n",
       "                    773,\n",
       "                    0.487\n",
       "                ],\n",
       "                [\n",
       "                    3212,\n",
       "                    0.471\n",
       "                ],\n",
       "                [\n",
       "                    885,\n",
       "                    0.465\n",
       "                ],\n",
       "                [\n",
       "                    755,\n",
       "                    0.461\n",
       "                ],\n",
       "                [\n",
       "                    552,\n",
       "                    0.461\n",
       "                ],\n",
       "                [\n",
       "                    643,\n",
       "                    0.46\n",
       "                ],\n",
       "                [\n",
       "                    321,\n",
       "                    0.455\n",
       "                ],\n",
       "                [\n",
       "                    456,\n",
       "                    0.449\n",
       "                ],\n",
       "                [\n",
       "                    902,\n",
       "                    0.437\n",
       "                ],\n",
       "                [\n",
       "                    911,\n",
       "                    0.436\n",
       "                ],\n",
       "                [\n",
       "                    722,\n",
       "                    0.431\n",
       "                ],\n",
       "                [\n",
       "                    539,\n",
       "                    0.421\n",
       "                ],\n",
       "                [\n",
       "                    534,\n",
       "                    0.417\n",
       "                ],\n",
       "                [\n",
       "                    451,\n",
       "                    0.417\n",
       "                ],\n",
       "                [\n",
       "                    850,\n",
       "                    0.414\n",
       "                ],\n",
       "                [\n",
       "                    598,\n",
       "                    0.407\n",
       "                ],\n",
       "                [\n",
       "                    964,\n",
       "                    0.406\n",
       "                ],\n",
       "                [\n",
       "                    771,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    916,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    364,\n",
       "                    0.387\n",
       "                ],\n",
       "                [\n",
       "                    666,\n",
       "                    0.384\n",
       "                ],\n",
       "                [\n",
       "                    1120,\n",
       "                    0.379\n",
       "                ],\n",
       "                [\n",
       "                    470,\n",
       "                    0.377\n",
       "                ],\n",
       "                [\n",
       "                    712,\n",
       "                    0.376\n",
       "                ],\n",
       "                [\n",
       "                    604,\n",
       "                    0.374\n",
       "                ],\n",
       "                [\n",
       "                    336,\n",
       "                    0.373\n",
       "                ],\n",
       "                [\n",
       "                    290,\n",
       "                    0.369\n",
       "                ],\n",
       "                [\n",
       "                    705,\n",
       "                    0.366\n",
       "                ],\n",
       "                [\n",
       "                    554,\n",
       "                    0.364\n",
       "                ],\n",
       "                [\n",
       "                    680,\n",
       "                    0.362\n",
       "                ],\n",
       "                [\n",
       "                    405,\n",
       "                    0.36\n",
       "                ],\n",
       "                [\n",
       "                    505,\n",
       "                    0.358\n",
       "                ],\n",
       "                [\n",
       "                    511,\n",
       "                    0.358\n",
       "                ],\n",
       "                [\n",
       "                    546,\n",
       "                    0.353\n",
       "                ],\n",
       "                [\n",
       "                    498,\n",
       "                    0.349\n",
       "                ],\n",
       "                [\n",
       "                    555,\n",
       "                    0.346\n",
       "                ],\n",
       "                [\n",
       "                    874,\n",
       "                    0.345\n",
       "                ],\n",
       "                [\n",
       "                    459,\n",
       "                    0.345\n",
       "                ],\n",
       "                [\n",
       "                    436,\n",
       "                    0.343\n",
       "                ],\n",
       "                [\n",
       "                    835,\n",
       "                    0.336\n",
       "                ],\n",
       "                [\n",
       "                    219,\n",
       "                    0.334\n",
       "                ],\n",
       "                [\n",
       "                    401,\n",
       "                    0.328\n",
       "                ],\n",
       "                [\n",
       "                    526,\n",
       "                    0.327\n",
       "                ],\n",
       "                [\n",
       "                    479,\n",
       "                    0.325\n",
       "                ],\n",
       "                [\n",
       "                    390,\n",
       "                    0.319\n",
       "                ],\n",
       "                [\n",
       "                    664,\n",
       "                    0.318\n",
       "                ],\n",
       "                [\n",
       "                    988,\n",
       "                    0.313\n",
       "                ],\n",
       "                [\n",
       "                    1101,\n",
       "                    0.31\n",
       "                ],\n",
       "                [\n",
       "                    505,\n",
       "                    0.309\n",
       "                ],\n",
       "                [\n",
       "                    345,\n",
       "                    0.309\n",
       "                ],\n",
       "                [\n",
       "                    1239,\n",
       "                    0.298\n",
       "                ],\n",
       "                [\n",
       "                    617,\n",
       "                    0.298\n",
       "                ],\n",
       "                [\n",
       "                    527,\n",
       "                    0.297\n",
       "                ],\n",
       "                [\n",
       "                    730,\n",
       "                    0.294\n",
       "                ],\n",
       "                [\n",
       "                    561,\n",
       "                    0.294\n",
       "                ],\n",
       "                [\n",
       "                    941,\n",
       "                    0.292\n",
       "                ],\n",
       "                [\n",
       "                    664,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    407,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    486,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    698,\n",
       "                    0.287\n",
       "                ],\n",
       "                [\n",
       "                    398,\n",
       "                    0.286\n",
       "                ],\n",
       "                [\n",
       "                    879,\n",
       "                    0.282\n",
       "                ],\n",
       "                [\n",
       "                    314,\n",
       "                    0.282\n",
       "                ],\n",
       "                [\n",
       "                    460,\n",
       "                    0.276\n",
       "                ],\n",
       "                [\n",
       "                    924,\n",
       "                    0.274\n",
       "                ],\n",
       "                [\n",
       "                    660,\n",
       "                    0.271\n",
       "                ],\n",
       "                [\n",
       "                    458,\n",
       "                    0.27\n",
       "                ],\n",
       "                [\n",
       "                    1257,\n",
       "                    0.267\n",
       "                ],\n",
       "                [\n",
       "                    362,\n",
       "                    0.263\n",
       "                ],\n",
       "                [\n",
       "                    270,\n",
       "                    0.254\n",
       "                ],\n",
       "                [\n",
       "                    879,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    500,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    700,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    576,\n",
       "                    0.225\n",
       "                ],\n",
       "                [\n",
       "                    215,\n",
       "                    0.196\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                1768,\n",
       "                2489,\n",
       "                2189,\n",
       "                1881,\n",
       "                1364,\n",
       "                1284,\n",
       "                942,\n",
       "                528,\n",
       "                747,\n",
       "                1220,\n",
       "                1053,\n",
       "                2119,\n",
       "                961,\n",
       "                946,\n",
       "                1023,\n",
       "                1274,\n",
       "                1373,\n",
       "                1025,\n",
       "                954,\n",
       "                244,\n",
       "                1316,\n",
       "                933,\n",
       "                534,\n",
       "                441,\n",
       "                842,\n",
       "                773,\n",
       "                3212,\n",
       "                885,\n",
       "                755,\n",
       "                552,\n",
       "                643,\n",
       "                321,\n",
       "                456,\n",
       "                902,\n",
       "                911,\n",
       "                722,\n",
       "                539,\n",
       "                534,\n",
       "                451,\n",
       "                850,\n",
       "                598,\n",
       "                964,\n",
       "                771,\n",
       "                916,\n",
       "                364,\n",
       "                666,\n",
       "                1120,\n",
       "                470,\n",
       "                712,\n",
       "                604,\n",
       "                336,\n",
       "                290,\n",
       "                705,\n",
       "                554,\n",
       "                680,\n",
       "                405,\n",
       "                505,\n",
       "                511,\n",
       "                546,\n",
       "                498,\n",
       "                555,\n",
       "                874,\n",
       "                459,\n",
       "                436,\n",
       "                835,\n",
       "                219,\n",
       "                401,\n",
       "                526,\n",
       "                479,\n",
       "                390,\n",
       "                664,\n",
       "                988,\n",
       "                1101,\n",
       "                505,\n",
       "                345,\n",
       "                1239,\n",
       "                617,\n",
       "                527,\n",
       "                730,\n",
       "                561,\n",
       "                941,\n",
       "                664,\n",
       "                407,\n",
       "                486,\n",
       "                698,\n",
       "                398,\n",
       "                879,\n",
       "                314,\n",
       "                460,\n",
       "                924,\n",
       "                660,\n",
       "                458,\n",
       "                1257,\n",
       "                362,\n",
       "                270,\n",
       "                879,\n",
       "                500,\n",
       "                700,\n",
       "                576,\n",
       "                215\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Diagram of (index-resident)\",\n",
       "            \"left\": \"ceter\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_1f332a62341746689f311aa2cd32b308.setOption(option_1f332a62341746689f311aa2cd32b308);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e3ba7020d0>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "scatter.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "d2569633",
   "metadata": {},
   "outputs": [],
   "source": [
    "#导入.csv文件，用read_csv(),并读取前100行以及0,1,5三列\n",
    "df = pd.read_csv('Factors .csv',encoding='gbk',nrows=101,usecols=[0,1,5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "adb12d0f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>province</th>\n",
       "      <th>index</th>\n",
       "      <th>income</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>深圳市</td>\n",
       "      <td>0.914</td>\n",
       "      <td>70847</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海市</td>\n",
       "      <td>0.791</td>\n",
       "      <td>78027</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>北京市</td>\n",
       "      <td>0.758</td>\n",
       "      <td>75002</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>广州市</td>\n",
       "      <td>0.723</td>\n",
       "      <td>68908</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>武汉市</td>\n",
       "      <td>0.646</td>\n",
       "      <td>41253</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>赣州市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>26899</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>宜春市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>28268</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>驻马店市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>22440</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>曲靖市</td>\n",
       "      <td>0.225</td>\n",
       "      <td>30545</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>鄂尔多斯</td>\n",
       "      <td>0.196</td>\n",
       "      <td>45638</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   province  index  income\n",
       "0      深圳市   0.914   70847\n",
       "1     上海市    0.791   78027\n",
       "2     北京市    0.758   75002\n",
       "3      广州市   0.723   68908\n",
       "4      武汉市   0.646   41253\n",
       "..      ...    ...     ...\n",
       "95     赣州市   0.248   26899\n",
       "96     宜春市   0.248   28268\n",
       "97    驻马店市   0.248   22440\n",
       "98     曲靖市   0.225   30545\n",
       "99    鄂尔多斯   0.196   45638\n",
       "\n",
       "[100 rows x 3 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "b981c5bc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 100 entries, 0 to 99\n",
      "Data columns (total 3 columns):\n",
      " #   Column    Non-Null Count  Dtype  \n",
      "---  ------    --------------  -----  \n",
      " 0   province  100 non-null    object \n",
      " 1   index     100 non-null    float64\n",
      " 2   income    100 non-null    int64  \n",
      "dtypes: float64(1), int64(1), object(1)\n",
      "memory usage: 2.5+ KB\n"
     ]
    }
   ],
   "source": [
    "#了解数据概况，100行，3列\n",
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "624ca0ab",
   "metadata": {},
   "outputs": [],
   "source": [
    "index = df[\"index\"].to_list()\n",
    "income = df[\"income\"].to_list()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "aea79154",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Scatter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "9d33951d",
   "metadata": {},
   "outputs": [],
   "source": [
    "scatter = (\n",
    "    Scatter()\n",
    "    .add_xaxis(\n",
    "        xaxis_data=income#定义x数据\n",
    "    )\n",
    "    .add_yaxis(\n",
    "        series_name=\"\",\n",
    "        y_axis=index,#定义y数据\n",
    "        symbol_size=4,#点的大小\n",
    "        label_opts=opts.LabelOpts(is_show=False)#不显示数值\n",
    "    )\n",
    "    .set_global_opts(#全局参数\n",
    "        xaxis_opts=opts.AxisOpts(type_=\"value\"),\n",
    "        yaxis_opts=opts.AxisOpts(type_=\"value\"),#y数据作为数值处理\n",
    "        title_opts=opts.TitleOpts(title=\"Diagram of (index-income)\",pos_left=\"ceter\")\n",
    "    )\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "e85c0ba6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"b86e6d8ce1f9446196c81b80956ee43c\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_b86e6d8ce1f9446196c81b80956ee43c = echarts.init(\n",
       "                    document.getElementById('b86e6d8ce1f9446196c81b80956ee43c'), 'white', {renderer: 'canvas'});\n",
       "                var option_b86e6d8ce1f9446196c81b80956ee43c = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    70847,\n",
       "                    0.914\n",
       "                ],\n",
       "                [\n",
       "                    78027,\n",
       "                    0.791\n",
       "                ],\n",
       "                [\n",
       "                    75002,\n",
       "                    0.758\n",
       "                ],\n",
       "                [\n",
       "                    68908,\n",
       "                    0.723\n",
       "                ],\n",
       "                [\n",
       "                    41253,\n",
       "                    0.646\n",
       "                ],\n",
       "                [\n",
       "                    68191,\n",
       "                    0.645\n",
       "                ],\n",
       "                [\n",
       "                    66140,\n",
       "                    0.645\n",
       "                ],\n",
       "                [\n",
       "                    67197,\n",
       "                    0.607\n",
       "                ],\n",
       "                [\n",
       "                    63014,\n",
       "                    0.604\n",
       "                ],\n",
       "                [\n",
       "                    67709,\n",
       "                    0.598\n",
       "                ],\n",
       "                [\n",
       "                    62126,\n",
       "                    0.593\n",
       "                ],\n",
       "                [\n",
       "                    45755,\n",
       "                    0.59\n",
       "                ],\n",
       "                [\n",
       "                    61700,\n",
       "                    0.585\n",
       "                ],\n",
       "                [\n",
       "                    46009,\n",
       "                    0.582\n",
       "                ],\n",
       "                [\n",
       "                    55587,\n",
       "                    0.57\n",
       "                ],\n",
       "                [\n",
       "                    39511,\n",
       "                    0.564\n",
       "                ],\n",
       "                [\n",
       "                    47449,\n",
       "                    0.56\n",
       "                ],\n",
       "                [\n",
       "                    51223,\n",
       "                    0.559\n",
       "                ],\n",
       "                [\n",
       "                    65436,\n",
       "                    0.547\n",
       "                ],\n",
       "                [\n",
       "                    61390,\n",
       "                    0.546\n",
       "                ],\n",
       "                [\n",
       "                    38701,\n",
       "                    0.532\n",
       "                ],\n",
       "                [\n",
       "                    46725,\n",
       "                    0.53\n",
       "                ],\n",
       "                [\n",
       "                    56897,\n",
       "                    0.529\n",
       "                ],\n",
       "                [\n",
       "                    57901,\n",
       "                    0.508\n",
       "                ],\n",
       "                [\n",
       "                    44249,\n",
       "                    0.487\n",
       "                ],\n",
       "                [\n",
       "                    46882,\n",
       "                    0.487\n",
       "                ],\n",
       "                [\n",
       "                    33803,\n",
       "                    0.471\n",
       "                ],\n",
       "                [\n",
       "                    44331,\n",
       "                    0.465\n",
       "                ],\n",
       "                [\n",
       "                    44267,\n",
       "                    0.461\n",
       "                ],\n",
       "                [\n",
       "                    60048,\n",
       "                    0.461\n",
       "                ],\n",
       "                [\n",
       "                    40214,\n",
       "                    0.46\n",
       "                ],\n",
       "                [\n",
       "                    50360,\n",
       "                    0.455\n",
       "                ],\n",
       "                [\n",
       "                    42287,\n",
       "                    0.449\n",
       "                ],\n",
       "                [\n",
       "                    34217,\n",
       "                    0.437\n",
       "                ],\n",
       "                [\n",
       "                    41000,\n",
       "                    0.436\n",
       "                ],\n",
       "                [\n",
       "                    42629,\n",
       "                    0.431\n",
       "                ],\n",
       "                [\n",
       "                    38381,\n",
       "                    0.421\n",
       "                ],\n",
       "                [\n",
       "                    62509,\n",
       "                    0.417\n",
       "                ],\n",
       "                [\n",
       "                    43777,\n",
       "                    0.417\n",
       "                ],\n",
       "                [\n",
       "                    42533,\n",
       "                    0.414\n",
       "                ],\n",
       "                [\n",
       "                    33221,\n",
       "                    0.407\n",
       "                ],\n",
       "                [\n",
       "                    59588,\n",
       "                    0.406\n",
       "                ],\n",
       "                [\n",
       "                    37661,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    32567,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    35889,\n",
       "                    0.387\n",
       "                ],\n",
       "                [\n",
       "                    55499,\n",
       "                    0.384\n",
       "                ],\n",
       "                [\n",
       "                    33555,\n",
       "                    0.379\n",
       "                ],\n",
       "                [\n",
       "                    42300,\n",
       "                    0.377\n",
       "                ],\n",
       "                [\n",
       "                    55900,\n",
       "                    0.376\n",
       "                ],\n",
       "                [\n",
       "                    43351,\n",
       "                    0.374\n",
       "                ],\n",
       "                [\n",
       "                    57000,\n",
       "                    0.373\n",
       "                ],\n",
       "                [\n",
       "                    44612,\n",
       "                    0.369\n",
       "                ],\n",
       "                [\n",
       "                    30200,\n",
       "                    0.366\n",
       "                ],\n",
       "                [\n",
       "                    37103,\n",
       "                    0.364\n",
       "                ],\n",
       "                [\n",
       "                    36764,\n",
       "                    0.362\n",
       "                ],\n",
       "                [\n",
       "                    37745,\n",
       "                    0.36\n",
       "                ],\n",
       "                [\n",
       "                    33818,\n",
       "                    0.358\n",
       "                ],\n",
       "                [\n",
       "                    29027,\n",
       "                    0.358\n",
       "                ],\n",
       "                [\n",
       "                    37347,\n",
       "                    0.353\n",
       "                ],\n",
       "                [\n",
       "                    29122,\n",
       "                    0.349\n",
       "                ],\n",
       "                [\n",
       "                    34731,\n",
       "                    0.346\n",
       "                ],\n",
       "                [\n",
       "                    32679,\n",
       "                    0.345\n",
       "                ],\n",
       "                [\n",
       "                    32295,\n",
       "                    0.345\n",
       "                ],\n",
       "                [\n",
       "                    29786,\n",
       "                    0.343\n",
       "                ],\n",
       "                [\n",
       "                    31845,\n",
       "                    0.336\n",
       "                ],\n",
       "                [\n",
       "                    46808,\n",
       "                    0.334\n",
       "                ],\n",
       "                [\n",
       "                    30567,\n",
       "                    0.328\n",
       "                ],\n",
       "                [\n",
       "                    30829,\n",
       "                    0.327\n",
       "                ],\n",
       "                [\n",
       "                    37068,\n",
       "                    0.325\n",
       "                ],\n",
       "                [\n",
       "                    42402,\n",
       "                    0.319\n",
       "                ],\n",
       "                [\n",
       "                    27457,\n",
       "                    0.318\n",
       "                ],\n",
       "                [\n",
       "                    33646,\n",
       "                    0.313\n",
       "                ],\n",
       "                [\n",
       "                    31528,\n",
       "                    0.31\n",
       "                ],\n",
       "                [\n",
       "                    31236,\n",
       "                    0.309\n",
       "                ],\n",
       "                [\n",
       "                    42277,\n",
       "                    0.309\n",
       "                ],\n",
       "                [\n",
       "                    25489,\n",
       "                    0.298\n",
       "                ],\n",
       "                [\n",
       "                    25787,\n",
       "                    0.298\n",
       "                ],\n",
       "                [\n",
       "                    28733,\n",
       "                    0.297\n",
       "                ],\n",
       "                [\n",
       "                    29146,\n",
       "                    0.294\n",
       "                ],\n",
       "                [\n",
       "                    25826,\n",
       "                    0.294\n",
       "                ],\n",
       "                [\n",
       "                    29287,\n",
       "                    0.292\n",
       "                ],\n",
       "                [\n",
       "                    32577,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    33036,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    32354,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    27646,\n",
       "                    0.287\n",
       "                ],\n",
       "                [\n",
       "                    31976,\n",
       "                    0.286\n",
       "                ],\n",
       "                [\n",
       "                    23854,\n",
       "                    0.282\n",
       "                ],\n",
       "                [\n",
       "                    31460,\n",
       "                    0.282\n",
       "                ],\n",
       "                [\n",
       "                    30610,\n",
       "                    0.276\n",
       "                ],\n",
       "                [\n",
       "                    28252,\n",
       "                    0.274\n",
       "                ],\n",
       "                [\n",
       "                    28054,\n",
       "                    0.271\n",
       "                ],\n",
       "                [\n",
       "                    31024,\n",
       "                    0.27\n",
       "                ],\n",
       "                [\n",
       "                    20773,\n",
       "                    0.267\n",
       "                ],\n",
       "                [\n",
       "                    28073,\n",
       "                    0.263\n",
       "                ],\n",
       "                [\n",
       "                    49353,\n",
       "                    0.254\n",
       "                ],\n",
       "                [\n",
       "                    26899,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    28268,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    22440,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    30545,\n",
       "                    0.225\n",
       "                ],\n",
       "                [\n",
       "                    45638,\n",
       "                    0.196\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                70847,\n",
       "                78027,\n",
       "                75002,\n",
       "                68908,\n",
       "                41253,\n",
       "                68191,\n",
       "                66140,\n",
       "                67197,\n",
       "                63014,\n",
       "                67709,\n",
       "                62126,\n",
       "                45755,\n",
       "                61700,\n",
       "                46009,\n",
       "                55587,\n",
       "                39511,\n",
       "                47449,\n",
       "                51223,\n",
       "                65436,\n",
       "                61390,\n",
       "                38701,\n",
       "                46725,\n",
       "                56897,\n",
       "                57901,\n",
       "                44249,\n",
       "                46882,\n",
       "                33803,\n",
       "                44331,\n",
       "                44267,\n",
       "                60048,\n",
       "                40214,\n",
       "                50360,\n",
       "                42287,\n",
       "                34217,\n",
       "                41000,\n",
       "                42629,\n",
       "                38381,\n",
       "                62509,\n",
       "                43777,\n",
       "                42533,\n",
       "                33221,\n",
       "                59588,\n",
       "                37661,\n",
       "                32567,\n",
       "                35889,\n",
       "                55499,\n",
       "                33555,\n",
       "                42300,\n",
       "                55900,\n",
       "                43351,\n",
       "                57000,\n",
       "                44612,\n",
       "                30200,\n",
       "                37103,\n",
       "                36764,\n",
       "                37745,\n",
       "                33818,\n",
       "                29027,\n",
       "                37347,\n",
       "                29122,\n",
       "                34731,\n",
       "                32679,\n",
       "                32295,\n",
       "                29786,\n",
       "                31845,\n",
       "                46808,\n",
       "                30567,\n",
       "                30829,\n",
       "                37068,\n",
       "                42402,\n",
       "                27457,\n",
       "                33646,\n",
       "                31528,\n",
       "                31236,\n",
       "                42277,\n",
       "                25489,\n",
       "                25787,\n",
       "                28733,\n",
       "                29146,\n",
       "                25826,\n",
       "                29287,\n",
       "                32577,\n",
       "                33036,\n",
       "                32354,\n",
       "                27646,\n",
       "                31976,\n",
       "                23854,\n",
       "                31460,\n",
       "                30610,\n",
       "                28252,\n",
       "                28054,\n",
       "                31024,\n",
       "                20773,\n",
       "                28073,\n",
       "                49353,\n",
       "                26899,\n",
       "                28268,\n",
       "                22440,\n",
       "                30545,\n",
       "                45638\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Diagram of (index-income)\",\n",
       "            \"left\": \"ceter\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_b86e6d8ce1f9446196c81b80956ee43c.setOption(option_b86e6d8ce1f9446196c81b80956ee43c);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e3b7fe1220>"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "scatter.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "88bc1179",
   "metadata": {},
   "outputs": [],
   "source": [
    "#导入.csv文件，用read_csv(),并读取前100行以及0,1,6三列\n",
    "df = pd.read_csv('Factors .csv',encoding='gbk',nrows=101,usecols=[0,1,6])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "1f462a1e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>province</th>\n",
       "      <th>index</th>\n",
       "      <th>inflow</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>深圳市</td>\n",
       "      <td>0.914</td>\n",
       "      <td>1178.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海市</td>\n",
       "      <td>0.791</td>\n",
       "      <td>1009.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>北京市</td>\n",
       "      <td>0.758</td>\n",
       "      <td>788.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>广州市</td>\n",
       "      <td>0.723</td>\n",
       "      <td>888.92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>武汉市</td>\n",
       "      <td>0.646</td>\n",
       "      <td>316.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>赣州市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>9.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>宜春市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>-32.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>驻马店市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>9.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>曲靖市</td>\n",
       "      <td>0.225</td>\n",
       "      <td>2.68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>鄂尔多斯</td>\n",
       "      <td>0.196</td>\n",
       "      <td>16.36</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   province  index   inflow\n",
       "0      深圳市   0.914  1178.80\n",
       "1     上海市    0.791  1009.00\n",
       "2     北京市    0.758   788.20\n",
       "3      广州市   0.723   888.92\n",
       "4      武汉市   0.646   316.50\n",
       "..      ...    ...      ...\n",
       "95     赣州市   0.248     9.80\n",
       "96     宜春市   0.248   -32.10\n",
       "97    驻马店市   0.248     9.20\n",
       "98     曲靖市   0.225     2.68\n",
       "99    鄂尔多斯   0.196    16.36\n",
       "\n",
       "[100 rows x 3 columns]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "3afd214d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 100 entries, 0 to 99\n",
      "Data columns (total 3 columns):\n",
      " #   Column    Non-Null Count  Dtype  \n",
      "---  ------    --------------  -----  \n",
      " 0   province  100 non-null    object \n",
      " 1   index     100 non-null    float64\n",
      " 2   inflow    100 non-null    float64\n",
      "dtypes: float64(2), object(1)\n",
      "memory usage: 2.5+ KB\n"
     ]
    }
   ],
   "source": [
    "#了解数据概况，100行，3列\n",
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "11b31865",
   "metadata": {},
   "outputs": [],
   "source": [
    "index = df[\"index\"].to_list()\n",
    "inflow = df[\"inflow\"].to_list()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "98b2a8a1",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Scatter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "e13e8671",
   "metadata": {},
   "outputs": [],
   "source": [
    "scatter = (\n",
    "    Scatter()\n",
    "    .add_xaxis(\n",
    "        xaxis_data=inflow#定义x数据\n",
    "    )\n",
    "    .add_yaxis(\n",
    "        series_name=\"\",\n",
    "        y_axis=index,#定义y数据\n",
    "        symbol_size=4,#点的大小\n",
    "        label_opts=opts.LabelOpts(is_show=False)#不显示数值\n",
    "    )\n",
    "    .set_global_opts(#全局参数\n",
    "        xaxis_opts=opts.AxisOpts(type_=\"value\"),\n",
    "        yaxis_opts=opts.AxisOpts(type_=\"value\"),#y数据作为数值处理\n",
    "        title_opts=opts.TitleOpts(title=\"Diagram of (index-inflow)\",pos_left=\"ceter\")\n",
    "    )\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "161b0363",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"1555b6e1bb0245aea94abe1483e5c144\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_1555b6e1bb0245aea94abe1483e5c144 = echarts.init(\n",
       "                    document.getElementById('1555b6e1bb0245aea94abe1483e5c144'), 'white', {renderer: 'canvas'});\n",
       "                var option_1555b6e1bb0245aea94abe1483e5c144 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    1178.8,\n",
       "                    0.914\n",
       "                ],\n",
       "                [\n",
       "                    1009.0,\n",
       "                    0.791\n",
       "                ],\n",
       "                [\n",
       "                    788.2,\n",
       "                    0.758\n",
       "                ],\n",
       "                [\n",
       "                    888.92,\n",
       "                    0.723\n",
       "                ],\n",
       "                [\n",
       "                    316.5,\n",
       "                    0.646\n",
       "                ],\n",
       "                [\n",
       "                    530.63,\n",
       "                    0.645\n",
       "                ],\n",
       "                [\n",
       "                    208.9,\n",
       "                    0.645\n",
       "                ],\n",
       "                [\n",
       "                    254.0,\n",
       "                    0.607\n",
       "                ],\n",
       "                [\n",
       "                    186.48,\n",
       "                    0.604\n",
       "                ],\n",
       "                [\n",
       "                    379.8,\n",
       "                    0.598\n",
       "                ],\n",
       "                [\n",
       "                    784.48,\n",
       "                    0.593\n",
       "                ],\n",
       "                [\n",
       "                    593.73,\n",
       "                    0.59\n",
       "                ],\n",
       "                [\n",
       "                    478.11,\n",
       "                    0.585\n",
       "                ],\n",
       "                [\n",
       "                    56.67,\n",
       "                    0.582\n",
       "                ],\n",
       "                [\n",
       "                    73.47,\n",
       "                    0.57\n",
       "                ],\n",
       "                [\n",
       "                    172.0,\n",
       "                    0.564\n",
       "                ],\n",
       "                [\n",
       "                    453.0,\n",
       "                    0.56\n",
       "                ],\n",
       "                [\n",
       "                    127.0,\n",
       "                    0.559\n",
       "                ],\n",
       "                [\n",
       "                    186.19,\n",
       "                    0.547\n",
       "                ],\n",
       "                [\n",
       "                    56.67,\n",
       "                    0.546\n",
       "                ],\n",
       "                [\n",
       "                    69.31,\n",
       "                    0.532\n",
       "                ],\n",
       "                [\n",
       "                    95.75,\n",
       "                    0.53\n",
       "                ],\n",
       "                [\n",
       "                    113.91,\n",
       "                    0.529\n",
       "                ],\n",
       "                [\n",
       "                    12.8,\n",
       "                    0.508\n",
       "                ],\n",
       "                [\n",
       "                    123.72,\n",
       "                    0.487\n",
       "                ],\n",
       "                [\n",
       "                    -25.47,\n",
       "                    0.487\n",
       "                ],\n",
       "                [\n",
       "                    207.3,\n",
       "                    0.471\n",
       "                ],\n",
       "                [\n",
       "                    122.09,\n",
       "                    0.465\n",
       "                ],\n",
       "                [\n",
       "                    108.9,\n",
       "                    0.461\n",
       "                ],\n",
       "                [\n",
       "                    111.28,\n",
       "                    0.461\n",
       "                ],\n",
       "                [\n",
       "                    18.9,\n",
       "                    0.46\n",
       "                ],\n",
       "                [\n",
       "                    54.08,\n",
       "                    0.455\n",
       "                ],\n",
       "                [\n",
       "                    -11.7,\n",
       "                    0.449\n",
       "                ],\n",
       "                [\n",
       "                    -151.0,\n",
       "                    0.437\n",
       "                ],\n",
       "                [\n",
       "                    108.0,\n",
       "                    0.436\n",
       "                ],\n",
       "                [\n",
       "                    58.0,\n",
       "                    0.431\n",
       "                ],\n",
       "                [\n",
       "                    115.63,\n",
       "                    0.421\n",
       "                ],\n",
       "                [\n",
       "                    63.47,\n",
       "                    0.417\n",
       "                ],\n",
       "                [\n",
       "                    103.88,\n",
       "                    0.417\n",
       "                ],\n",
       "                [\n",
       "                    83.01,\n",
       "                    0.414\n",
       "                ],\n",
       "                [\n",
       "                    70.64,\n",
       "                    0.407\n",
       "                ],\n",
       "                [\n",
       "                    125.39,\n",
       "                    0.406\n",
       "                ],\n",
       "                [\n",
       "                    29.45,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    22.47,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    147.21,\n",
       "                    0.387\n",
       "                ],\n",
       "                [\n",
       "                    28.0,\n",
       "                    0.384\n",
       "                ],\n",
       "                [\n",
       "                    51.6,\n",
       "                    0.379\n",
       "                ],\n",
       "                [\n",
       "                    44.26,\n",
       "                    0.377\n",
       "                ],\n",
       "                [\n",
       "                    71.0,\n",
       "                    0.376\n",
       "                ],\n",
       "                [\n",
       "                    6.3,\n",
       "                    0.374\n",
       "                ],\n",
       "                [\n",
       "                    98.3,\n",
       "                    0.373\n",
       "                ],\n",
       "                [\n",
       "                    29.67,\n",
       "                    0.369\n",
       "                ],\n",
       "                [\n",
       "                    22.0,\n",
       "                    0.366\n",
       "                ],\n",
       "                [\n",
       "                    52.74,\n",
       "                    0.364\n",
       "                ],\n",
       "                [\n",
       "                    100.77,\n",
       "                    0.362\n",
       "                ],\n",
       "                [\n",
       "                    87.2,\n",
       "                    0.36\n",
       "                ],\n",
       "                [\n",
       "                    -18.52,\n",
       "                    0.358\n",
       "                ],\n",
       "                [\n",
       "                    7.8,\n",
       "                    0.358\n",
       "                ],\n",
       "                [\n",
       "                    36.78,\n",
       "                    0.353\n",
       "                ],\n",
       "                [\n",
       "                    15.89,\n",
       "                    0.349\n",
       "                ],\n",
       "                [\n",
       "                    -66.51,\n",
       "                    0.346\n",
       "                ],\n",
       "                [\n",
       "                    11.0,\n",
       "                    0.345\n",
       "                ],\n",
       "                [\n",
       "                    25.54,\n",
       "                    0.345\n",
       "                ],\n",
       "                [\n",
       "                    12.45,\n",
       "                    0.343\n",
       "                ],\n",
       "                [\n",
       "                    -40.29,\n",
       "                    0.336\n",
       "                ],\n",
       "                [\n",
       "                    22.4,\n",
       "                    0.334\n",
       "                ],\n",
       "                [\n",
       "                    4.0,\n",
       "                    0.328\n",
       "                ],\n",
       "                [\n",
       "                    12.0,\n",
       "                    0.327\n",
       "                ],\n",
       "                [\n",
       "                    56.8,\n",
       "                    0.325\n",
       "                ],\n",
       "                [\n",
       "                    11.33,\n",
       "                    0.319\n",
       "                ],\n",
       "                [\n",
       "                    -18.35,\n",
       "                    0.318\n",
       "                ],\n",
       "                [\n",
       "                    16.9,\n",
       "                    0.313\n",
       "                ],\n",
       "                [\n",
       "                    18.0,\n",
       "                    0.31\n",
       "                ],\n",
       "                [\n",
       "                    12.0,\n",
       "                    0.309\n",
       "                ],\n",
       "                [\n",
       "                    35.8,\n",
       "                    0.309\n",
       "                ],\n",
       "                [\n",
       "                    11.8,\n",
       "                    0.298\n",
       "                ],\n",
       "                [\n",
       "                    35.33,\n",
       "                    0.298\n",
       "                ],\n",
       "                [\n",
       "                    13.0,\n",
       "                    0.297\n",
       "                ],\n",
       "                [\n",
       "                    11.2,\n",
       "                    0.294\n",
       "                ],\n",
       "                [\n",
       "                    45.5,\n",
       "                    0.294\n",
       "                ],\n",
       "                [\n",
       "                    9.2,\n",
       "                    0.292\n",
       "                ],\n",
       "                [\n",
       "                    22.0,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    -34.56,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    -21.93,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    46.98,\n",
       "                    0.287\n",
       "                ],\n",
       "                [\n",
       "                    58.43,\n",
       "                    0.286\n",
       "                ],\n",
       "                [\n",
       "                    12.0,\n",
       "                    0.282\n",
       "                ],\n",
       "                [\n",
       "                    -41.46,\n",
       "                    0.282\n",
       "                ],\n",
       "                [\n",
       "                    12.45,\n",
       "                    0.276\n",
       "                ],\n",
       "                [\n",
       "                    30.47,\n",
       "                    0.274\n",
       "                ],\n",
       "                [\n",
       "                    10.9,\n",
       "                    0.271\n",
       "                ],\n",
       "                [\n",
       "                    -24.86,\n",
       "                    0.27\n",
       "                ],\n",
       "                [\n",
       "                    17.35,\n",
       "                    0.267\n",
       "                ],\n",
       "                [\n",
       "                    -23.4,\n",
       "                    0.263\n",
       "                ],\n",
       "                [\n",
       "                    -23.6,\n",
       "                    0.254\n",
       "                ],\n",
       "                [\n",
       "                    9.8,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    -32.1,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    9.2,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    2.68,\n",
       "                    0.225\n",
       "                ],\n",
       "                [\n",
       "                    16.36,\n",
       "                    0.196\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                1178.8,\n",
       "                1009.0,\n",
       "                788.2,\n",
       "                888.92,\n",
       "                316.5,\n",
       "                530.63,\n",
       "                208.9,\n",
       "                254.0,\n",
       "                186.48,\n",
       "                379.8,\n",
       "                784.48,\n",
       "                593.73,\n",
       "                478.11,\n",
       "                56.67,\n",
       "                73.47,\n",
       "                172.0,\n",
       "                453.0,\n",
       "                127.0,\n",
       "                186.19,\n",
       "                56.67,\n",
       "                69.31,\n",
       "                95.75,\n",
       "                113.91,\n",
       "                12.8,\n",
       "                123.72,\n",
       "                -25.47,\n",
       "                207.3,\n",
       "                122.09,\n",
       "                108.9,\n",
       "                111.28,\n",
       "                18.9,\n",
       "                54.08,\n",
       "                -11.7,\n",
       "                -151.0,\n",
       "                108.0,\n",
       "                58.0,\n",
       "                115.63,\n",
       "                63.47,\n",
       "                103.88,\n",
       "                83.01,\n",
       "                70.64,\n",
       "                125.39,\n",
       "                29.45,\n",
       "                22.47,\n",
       "                147.21,\n",
       "                28.0,\n",
       "                51.6,\n",
       "                44.26,\n",
       "                71.0,\n",
       "                6.3,\n",
       "                98.3,\n",
       "                29.67,\n",
       "                22.0,\n",
       "                52.74,\n",
       "                100.77,\n",
       "                87.2,\n",
       "                -18.52,\n",
       "                7.8,\n",
       "                36.78,\n",
       "                15.89,\n",
       "                -66.51,\n",
       "                11.0,\n",
       "                25.54,\n",
       "                12.45,\n",
       "                -40.29,\n",
       "                22.4,\n",
       "                4.0,\n",
       "                12.0,\n",
       "                56.8,\n",
       "                11.33,\n",
       "                -18.35,\n",
       "                16.9,\n",
       "                18.0,\n",
       "                12.0,\n",
       "                35.8,\n",
       "                11.8,\n",
       "                35.33,\n",
       "                13.0,\n",
       "                11.2,\n",
       "                45.5,\n",
       "                9.2,\n",
       "                22.0,\n",
       "                -34.56,\n",
       "                -21.93,\n",
       "                46.98,\n",
       "                58.43,\n",
       "                12.0,\n",
       "                -41.46,\n",
       "                12.45,\n",
       "                30.47,\n",
       "                10.9,\n",
       "                -24.86,\n",
       "                17.35,\n",
       "                -23.4,\n",
       "                -23.6,\n",
       "                9.8,\n",
       "                -32.1,\n",
       "                9.2,\n",
       "                2.68,\n",
       "                16.36\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Diagram of (index-inflow)\",\n",
       "            \"left\": \"ceter\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_1555b6e1bb0245aea94abe1483e5c144.setOption(option_1555b6e1bb0245aea94abe1483e5c144);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e3b9c9d3a0>"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "scatter.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "5b2fab16",
   "metadata": {},
   "outputs": [],
   "source": [
    "#导入.csv文件，用read_csv(),并读取前100行以及0,1,7三列\n",
    "df = pd.read_csv('Factors .csv',encoding='gbk',nrows=101,usecols=[0,1,7])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "37b51b69",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>province</th>\n",
       "      <th>index</th>\n",
       "      <th>household</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>深圳市</td>\n",
       "      <td>0.914</td>\n",
       "      <td>589.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>上海市</td>\n",
       "      <td>0.791</td>\n",
       "      <td>1480.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>北京市</td>\n",
       "      <td>0.758</td>\n",
       "      <td>1400.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>广州市</td>\n",
       "      <td>0.723</td>\n",
       "      <td>992.08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>武汉市</td>\n",
       "      <td>0.646</td>\n",
       "      <td>1047.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>赣州市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>869.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>宜春市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>532.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>驻马店市</td>\n",
       "      <td>0.248</td>\n",
       "      <td>690.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>曲靖市</td>\n",
       "      <td>0.225</td>\n",
       "      <td>573.32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>鄂尔多斯</td>\n",
       "      <td>0.196</td>\n",
       "      <td>198.64</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   province  index  household\n",
       "0      深圳市   0.914     589.20\n",
       "1     上海市    0.791    1480.00\n",
       "2     北京市    0.758    1400.40\n",
       "3      广州市   0.723     992.08\n",
       "4      武汉市   0.646    1047.50\n",
       "..      ...    ...        ...\n",
       "95     赣州市   0.248     869.20\n",
       "96     宜春市   0.248     532.10\n",
       "97    驻马店市   0.248     690.80\n",
       "98     曲靖市   0.225     573.32\n",
       "99    鄂尔多斯   0.196     198.64\n",
       "\n",
       "[100 rows x 3 columns]"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "f3b547f3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 100 entries, 0 to 99\n",
      "Data columns (total 3 columns):\n",
      " #   Column     Non-Null Count  Dtype  \n",
      "---  ------     --------------  -----  \n",
      " 0   province   100 non-null    object \n",
      " 1   index      100 non-null    float64\n",
      " 2   household  100 non-null    float64\n",
      "dtypes: float64(2), object(1)\n",
      "memory usage: 2.5+ KB\n"
     ]
    }
   ],
   "source": [
    "#了解数据概况，100行，3列\n",
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "116e7eae",
   "metadata": {},
   "outputs": [],
   "source": [
    "index = df[\"index\"].to_list()\n",
    "household = df[\"household\"].to_list()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "3e8b5056",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Scatter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "fc5c45b8",
   "metadata": {},
   "outputs": [],
   "source": [
    "scatter = (\n",
    "    Scatter()\n",
    "    .add_xaxis(\n",
    "        xaxis_data=household#定义x数据\n",
    "    )\n",
    "    .add_yaxis(\n",
    "        series_name=\"\",\n",
    "        y_axis=index,#定义y数据\n",
    "        symbol_size=4,#点的大小\n",
    "        label_opts=opts.LabelOpts(is_show=False)#不显示数值\n",
    "    )\n",
    "    .set_global_opts(#全局参数\n",
    "        xaxis_opts=opts.AxisOpts(type_=\"value\"),\n",
    "        yaxis_opts=opts.AxisOpts(type_=\"value\"),#y数据作为数值处理\n",
    "        title_opts=opts.TitleOpts(title=\"Diagram of (index-household)\",pos_left=\"ceter\")\n",
    "    )\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "14fc32d0",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"ef1be6d176714757ba0b569ec7b49643\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_ef1be6d176714757ba0b569ec7b49643 = echarts.init(\n",
       "                    document.getElementById('ef1be6d176714757ba0b569ec7b49643'), 'white', {renderer: 'canvas'});\n",
       "                var option_ef1be6d176714757ba0b569ec7b49643 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"symbolSize\": 4,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    589.2,\n",
       "                    0.914\n",
       "                ],\n",
       "                [\n",
       "                    1480.0,\n",
       "                    0.791\n",
       "                ],\n",
       "                [\n",
       "                    1400.4,\n",
       "                    0.758\n",
       "                ],\n",
       "                [\n",
       "                    992.08,\n",
       "                    0.723\n",
       "                ],\n",
       "                [\n",
       "                    1047.5,\n",
       "                    0.646\n",
       "                ],\n",
       "                [\n",
       "                    753.37,\n",
       "                    0.645\n",
       "                ],\n",
       "                [\n",
       "                    733.1,\n",
       "                    0.645\n",
       "                ],\n",
       "                [\n",
       "                    274.0,\n",
       "                    0.607\n",
       "                ],\n",
       "                [\n",
       "                    560.52,\n",
       "                    0.604\n",
       "                ],\n",
       "                [\n",
       "                    840.2,\n",
       "                    0.598\n",
       "                ],\n",
       "                [\n",
       "                    268.52,\n",
       "                    0.593\n",
       "                ],\n",
       "                [\n",
       "                    1525.27,\n",
       "                    0.59\n",
       "                ],\n",
       "                [\n",
       "                    482.89,\n",
       "                    0.585\n",
       "                ],\n",
       "                [\n",
       "                    889.33,\n",
       "                    0.582\n",
       "                ],\n",
       "                [\n",
       "                    949.53,\n",
       "                    0.57\n",
       "                ],\n",
       "                [\n",
       "                    1102.0,\n",
       "                    0.564\n",
       "                ],\n",
       "                [\n",
       "                    920.0,\n",
       "                    0.56\n",
       "                ],\n",
       "                [\n",
       "                    898.0,\n",
       "                    0.559\n",
       "                ],\n",
       "                [\n",
       "                    767.81,\n",
       "                    0.547\n",
       "                ],\n",
       "                [\n",
       "                    187.33,\n",
       "                    0.546\n",
       "                ],\n",
       "                [\n",
       "                    1246.69,\n",
       "                    0.532\n",
       "                ],\n",
       "                [\n",
       "                    837.25,\n",
       "                    0.53\n",
       "                ],\n",
       "                [\n",
       "                    420.09,\n",
       "                    0.529\n",
       "                ],\n",
       "                [\n",
       "                    428.2,\n",
       "                    0.508\n",
       "                ],\n",
       "                [\n",
       "                    718.28,\n",
       "                    0.487\n",
       "                ],\n",
       "                [\n",
       "                    798.47,\n",
       "                    0.487\n",
       "                ],\n",
       "                [\n",
       "                    3004.7,\n",
       "                    0.471\n",
       "                ],\n",
       "                [\n",
       "                    762.91,\n",
       "                    0.465\n",
       "                ],\n",
       "                [\n",
       "                    646.1,\n",
       "                    0.461\n",
       "                ],\n",
       "                [\n",
       "                    440.32,\n",
       "                    0.461\n",
       "                ],\n",
       "                [\n",
       "                    624.1,\n",
       "                    0.46\n",
       "                ],\n",
       "                [\n",
       "                    266.92,\n",
       "                    0.455\n",
       "                ],\n",
       "                [\n",
       "                    467.7,\n",
       "                    0.449\n",
       "                ],\n",
       "                [\n",
       "                    1053.0,\n",
       "                    0.437\n",
       "                ],\n",
       "                [\n",
       "                    803.0,\n",
       "                    0.436\n",
       "                ],\n",
       "                [\n",
       "                    664.0,\n",
       "                    0.431\n",
       "                ],\n",
       "                [\n",
       "                    423.37,\n",
       "                    0.421\n",
       "                ],\n",
       "                [\n",
       "                    470.23,\n",
       "                    0.417\n",
       "                ],\n",
       "                [\n",
       "                    347.12,\n",
       "                    0.417\n",
       "                ],\n",
       "                [\n",
       "                    766.99,\n",
       "                    0.414\n",
       "                ],\n",
       "                [\n",
       "                    527.36,\n",
       "                    0.407\n",
       "                ],\n",
       "                [\n",
       "                    838.61,\n",
       "                    0.406\n",
       "                ],\n",
       "                [\n",
       "                    741.55,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    893.53,\n",
       "                    0.4\n",
       "                ],\n",
       "                [\n",
       "                    216.79,\n",
       "                    0.387\n",
       "                ],\n",
       "                [\n",
       "                    638.1,\n",
       "                    0.384\n",
       "                ],\n",
       "                [\n",
       "                    1068.4,\n",
       "                    0.379\n",
       "                ],\n",
       "                [\n",
       "                    425.74,\n",
       "                    0.377\n",
       "                ],\n",
       "                [\n",
       "                    641.0,\n",
       "                    0.376\n",
       "                ],\n",
       "                [\n",
       "                    597.7,\n",
       "                    0.374\n",
       "                ],\n",
       "                [\n",
       "                    237.7,\n",
       "                    0.373\n",
       "                ],\n",
       "                [\n",
       "                    260.33,\n",
       "                    0.369\n",
       "                ],\n",
       "                [\n",
       "                    683.0,\n",
       "                    0.366\n",
       "                ],\n",
       "                [\n",
       "                    501.08,\n",
       "                    0.364\n",
       "                ],\n",
       "                [\n",
       "                    579.23,\n",
       "                    0.362\n",
       "                ],\n",
       "                [\n",
       "                    317.8,\n",
       "                    0.36\n",
       "                ],\n",
       "                [\n",
       "                    523.52,\n",
       "                    0.358\n",
       "                ],\n",
       "                [\n",
       "                    503.2,\n",
       "                    0.358\n",
       "                ],\n",
       "                [\n",
       "                    509.22,\n",
       "                    0.353\n",
       "                ],\n",
       "                [\n",
       "                    482.11,\n",
       "                    0.349\n",
       "                ],\n",
       "                [\n",
       "                    621.51,\n",
       "                    0.346\n",
       "                ],\n",
       "                [\n",
       "                    863.0,\n",
       "                    0.345\n",
       "                ],\n",
       "                [\n",
       "                    433.46,\n",
       "                    0.345\n",
       "                ],\n",
       "                [\n",
       "                    423.55,\n",
       "                    0.343\n",
       "                ],\n",
       "                [\n",
       "                    875.29,\n",
       "                    0.336\n",
       "                ],\n",
       "                [\n",
       "                    196.6,\n",
       "                    0.334\n",
       "                ],\n",
       "                [\n",
       "                    397.0,\n",
       "                    0.328\n",
       "                ],\n",
       "                [\n",
       "                    514.0,\n",
       "                    0.327\n",
       "                ],\n",
       "                [\n",
       "                    422.2,\n",
       "                    0.325\n",
       "                ],\n",
       "                [\n",
       "                    378.67,\n",
       "                    0.319\n",
       "                ],\n",
       "                [\n",
       "                    682.35,\n",
       "                    0.318\n",
       "                ],\n",
       "                [\n",
       "                    971.1,\n",
       "                    0.313\n",
       "                ],\n",
       "                [\n",
       "                    1083.0,\n",
       "                    0.31\n",
       "                ],\n",
       "                [\n",
       "                    493.0,\n",
       "                    0.309\n",
       "                ],\n",
       "                [\n",
       "                    309.2,\n",
       "                    0.309\n",
       "                ],\n",
       "                [\n",
       "                    1227.2,\n",
       "                    0.298\n",
       "                ],\n",
       "                [\n",
       "                    581.67,\n",
       "                    0.298\n",
       "                ],\n",
       "                [\n",
       "                    514.0,\n",
       "                    0.297\n",
       "                ],\n",
       "                [\n",
       "                    718.8,\n",
       "                    0.294\n",
       "                ],\n",
       "                [\n",
       "                    515.5,\n",
       "                    0.294\n",
       "                ],\n",
       "                [\n",
       "                    931.8,\n",
       "                    0.292\n",
       "                ],\n",
       "                [\n",
       "                    642.0,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    441.56,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    507.93,\n",
       "                    0.291\n",
       "                ],\n",
       "                [\n",
       "                    651.02,\n",
       "                    0.287\n",
       "                ],\n",
       "                [\n",
       "                    339.57,\n",
       "                    0.286\n",
       "                ],\n",
       "                [\n",
       "                    867.0,\n",
       "                    0.282\n",
       "                ],\n",
       "                [\n",
       "                    355.46,\n",
       "                    0.282\n",
       "                ],\n",
       "                [\n",
       "                    447.55,\n",
       "                    0.276\n",
       "                ],\n",
       "                [\n",
       "                    893.53,\n",
       "                    0.274\n",
       "                ],\n",
       "                [\n",
       "                    649.1,\n",
       "                    0.271\n",
       "                ],\n",
       "                [\n",
       "                    482.86,\n",
       "                    0.27\n",
       "                ],\n",
       "                [\n",
       "                    1239.65,\n",
       "                    0.267\n",
       "                ],\n",
       "                [\n",
       "                    385.4,\n",
       "                    0.263\n",
       "                ],\n",
       "                [\n",
       "                    293.6,\n",
       "                    0.254\n",
       "                ],\n",
       "                [\n",
       "                    869.2,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    532.1,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    690.8,\n",
       "                    0.248\n",
       "                ],\n",
       "                [\n",
       "                    573.32,\n",
       "                    0.225\n",
       "                ],\n",
       "                [\n",
       "                    198.64,\n",
       "                    0.196\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                589.2,\n",
       "                1480.0,\n",
       "                1400.4,\n",
       "                992.08,\n",
       "                1047.5,\n",
       "                753.37,\n",
       "                733.1,\n",
       "                274.0,\n",
       "                560.52,\n",
       "                840.2,\n",
       "                268.52,\n",
       "                1525.27,\n",
       "                482.89,\n",
       "                889.33,\n",
       "                949.53,\n",
       "                1102.0,\n",
       "                920.0,\n",
       "                898.0,\n",
       "                767.81,\n",
       "                187.33,\n",
       "                1246.69,\n",
       "                837.25,\n",
       "                420.09,\n",
       "                428.2,\n",
       "                718.28,\n",
       "                798.47,\n",
       "                3004.7,\n",
       "                762.91,\n",
       "                646.1,\n",
       "                440.32,\n",
       "                624.1,\n",
       "                266.92,\n",
       "                467.7,\n",
       "                1053.0,\n",
       "                803.0,\n",
       "                664.0,\n",
       "                423.37,\n",
       "                470.23,\n",
       "                347.12,\n",
       "                766.99,\n",
       "                527.36,\n",
       "                838.61,\n",
       "                741.55,\n",
       "                893.53,\n",
       "                216.79,\n",
       "                638.1,\n",
       "                1068.4,\n",
       "                425.74,\n",
       "                641.0,\n",
       "                597.7,\n",
       "                237.7,\n",
       "                260.33,\n",
       "                683.0,\n",
       "                501.08,\n",
       "                579.23,\n",
       "                317.8,\n",
       "                523.52,\n",
       "                503.2,\n",
       "                509.22,\n",
       "                482.11,\n",
       "                621.51,\n",
       "                863.0,\n",
       "                433.46,\n",
       "                423.55,\n",
       "                875.29,\n",
       "                196.6,\n",
       "                397.0,\n",
       "                514.0,\n",
       "                422.2,\n",
       "                378.67,\n",
       "                682.35,\n",
       "                971.1,\n",
       "                1083.0,\n",
       "                493.0,\n",
       "                309.2,\n",
       "                1227.2,\n",
       "                581.67,\n",
       "                514.0,\n",
       "                718.8,\n",
       "                515.5,\n",
       "                931.8,\n",
       "                642.0,\n",
       "                441.56,\n",
       "                507.93,\n",
       "                651.02,\n",
       "                339.57,\n",
       "                867.0,\n",
       "                355.46,\n",
       "                447.55,\n",
       "                893.53,\n",
       "                649.1,\n",
       "                482.86,\n",
       "                1239.65,\n",
       "                385.4,\n",
       "                293.6,\n",
       "                869.2,\n",
       "                532.1,\n",
       "                690.8,\n",
       "                573.32,\n",
       "                198.64\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Diagram of (index-household)\",\n",
       "            \"left\": \"ceter\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_ef1be6d176714757ba0b569ec7b49643.setOption(option_ef1be6d176714757ba0b569ec7b49643);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1e3ba74d9d0>"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "scatter.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "078df863",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
